//
//  Print.h
//  Charles
//
//  Created by Charles on 2019/5/30.
//  Copyright © 2019 charles. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

#pragma mark - 类适配器示例:使用继承的适配器
// Target
@protocol Print <NSObject>

- (void)printWeak;
- (void)printStrong;

@end
// Adaptee
@interface Banner : NSObject

@property (nonatomic, strong) NSString *string;

@end
// Adapter
@interface PrintBanner : Banner<Print>

- (instancetype)initWithString:(NSString *)string;
- (void)printWeak;
- (void)printStrong;

@end

#pragma mark - 对象适配器实例：使用委托的适配器
// Target
@interface Print : NSObject

- (void)printWeak;
- (void)printStrong;

@end
// Adapter
@interface PrintBanner2 : Print

@property (nonatomic, strong) Banner *banner;

- (instancetype)initWithString:(NSString *)string;
- (void)printWeak;
- (void)printStrong;

@end

NS_ASSUME_NONNULL_END
